package com.wicket.okrcomponent.biz.service.impl;

import cn.hutool.core.bean.BeanUtil;
import com.wicket.okrcomponent.biz.service.dto.req.*;
import com.wicket.okrcomponent.biz.service.dto.res.*;
import com.wicket.okrcomponent.common.exception.BizException;
import com.wicket.okrcomponent.common.util.CommonFunctionHelper;
import com.wicket.okrcomponent.common.util.RedisUtil;
import java.util.List;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.wicket.okrcomponent.base.service.MCustomFields3Service;
import com.wicket.okrcomponent.common.exception.Assert;
import com.wicket.okrcomponent.biz.service.nb.NbBusinessInterfaceMode;

/**
 * @author ：
 * @date ：
 *
 *
 * @version 1.0
 */
@Service
public class BusinessInterfaceModeServiceImpl
  implements com.wicket.okrcomponent.biz.service.BusinessInterfaceModeService {

  @Resource
  private RedisUtil redisUtil;
@Resource
  private MCustomFields3Service mCustomFields3Service;
@Resource
  private NbBusinessInterfaceMode nbBusinessInterfaceMode;
/**
   * D2执行数值精度处理(公共)[9447]
   * gen by moon at 4/26/2024, 2:22:33 PM
   */
  @Trace(operationName = "D2执行数值精度处理(公共)")
  @Tags({@Tag(key = "参数",value = "arg[0]"),
            @Tag(key = "返回值",value = "returnedObj")})
  @Transactional(rollbackFor=Exception.class)
  @Override
  public ImplementNumericalAccuracyProcessingComRespDto implementNumericalAccuracyProcessingCom(ImplementNumericalAccuracyProcessingComReqDto reqDto){
    
      
      ImplementNumericalAccuracyProcessingRespDto numericalAccuracyProcessingRes_1 =null;
//步骤0: M2执行数值精度处理（特殊方法） - implementNumericalAccuracyProcessing
     //ModelCode: numericalAccuracyProcessing
        ImplementNumericalAccuracyProcessingRespDto numericalAccuracyProcessingRes = null;
    ImplementNumericalAccuracyProcessingReqDto numericalAccuracyProcessingReq=new ImplementNumericalAccuracyProcessingReqDto();
  if(reqDto!=null){
      numericalAccuracyProcessingReq.setComFloatField(reqDto.getComFloatField());//SimpleFieldAssign//sourceId:1754815_1
numericalAccuracyProcessingReq.setDecimalPointRules(reqDto.getDecimalPointRules());//SimpleFieldAssign//sourceId:1754816_1
numericalAccuracyProcessingReq.setDecimalDigitsLastRules(reqDto.getDecimalDigitsLastRules());//SimpleFieldAssign//sourceId:1754817_1
    }
  
    /*M2执行数值精度处理（特殊方法）[9448]   */
    Assert.isNull(numericalAccuracyProcessingReq.getComFloatField(),"D2执行数值精度处理(公共)-M2执行数值精度处理（特殊方法）-通用数值字段（小数型）不能为空",false);
Assert.isNull(numericalAccuracyProcessingReq.getDecimalPointRules(),"D2执行数值精度处理(公共)-M2执行数值精度处理（特殊方法）-小数点规则不能为空",false);
Assert.isNull(numericalAccuracyProcessingReq.getDecimalDigitsLastRules(),"D2执行数值精度处理(公共)-M2执行数值精度处理（特殊方法）-小数最后一位规则不能为空",false);
      numericalAccuracyProcessingRes = nbBusinessInterfaceMode.implementNumericalAccuracyProcessing(numericalAccuracyProcessingReq);
      
      
      numericalAccuracyProcessingRes_1 = numericalAccuracyProcessingRes;
    
ImplementNumericalAccuracyProcessingComRespDto retData = new ImplementNumericalAccuracyProcessingComRespDto();
  if(numericalAccuracyProcessingRes_1!=null){
      retData.setComFloatField(numericalAccuracyProcessingRes_1.getComFloatField());//SimpleFieldAssign//sourceId:1754822_1
    }
  

  
  
return retData;
  }
  //
}
